[Piglit] [PATCH] hiz: added one new depth test with RGB565 color attachment

Tapani Pälli tapani.palli at intel.com
Wed Oct 31 06:38:42 PDT 2012


Signed-off-by: Tapani Pälli <tapani.palli at intel.com>
---
 tests/all.tests                              |    1 +
 tests/hiz/CMakeLists.gl.txt                  |    1 +
 tests/hiz/hiz-depth-test-fbo-d24-s0-RGB565.c |   68 ++++++++++++++++++++++++++
 3 files changed, 70 insertions(+)
 create mode 100644 tests/hiz/hiz-depth-test-fbo-d24-s0-RGB565.c

diff --git a/tests/all.tests b/tests/all.tests
index 0a8a5aa..cd06bc4 100644
--- a/tests/all.tests
+++ b/tests/all.tests
@@ -2134,6 +2134,7 @@ add_plain_test(hiz, 'hiz-depth-read-fbo-d24s8')
 add_plain_test(hiz, 'hiz-depth-read-window-stencil0')
 add_plain_test(hiz, 'hiz-depth-read-window-stencil1')
 add_plain_test(hiz, 'hiz-depth-test-fbo-d24-s0')
+add_plain_test(hiz, 'hiz-depth-test-fbo-d24-s0-RGB565')
 add_plain_test(hiz, 'hiz-depth-test-fbo-d24-s8')
 add_plain_test(hiz, 'hiz-depth-test-fbo-d24s8')
 add_plain_test(hiz, 'hiz-depth-test-window-stencil0')
diff --git a/tests/hiz/CMakeLists.gl.txt b/tests/hiz/CMakeLists.gl.txt
index d1615fc..91b7233 100644
--- a/tests/hiz/CMakeLists.gl.txt
+++ b/tests/hiz/CMakeLists.gl.txt
@@ -30,6 +30,7 @@ piglit_add_executable(hiz-depth-read-fbo-d24s8 hiz-depth-read-fbo-d24s8.c)
 piglit_add_executable(hiz-depth-read-window-stencil0 hiz-depth-read-window-stencil0.c)
 piglit_add_executable(hiz-depth-read-window-stencil1 hiz-depth-read-window-stencil1.c)
 piglit_add_executable(hiz-depth-test-fbo-d24-s0 hiz-depth-test-fbo-d24-s0.c)
+piglit_add_executable(hiz-depth-test-fbo-d24-s0-RGB565 hiz-depth-test-fbo-d24-s0-RGB565.c)
 piglit_add_executable(hiz-depth-test-fbo-d24-s8 hiz-depth-test-fbo-d24-s8.c)
 piglit_add_executable(hiz-depth-test-fbo-d24s8 hiz-depth-test-fbo-d24s8.c)
 piglit_add_executable(hiz-depth-test-window-stencil0 hiz-depth-test-window-stencil0.c)
diff --git a/tests/hiz/hiz-depth-test-fbo-d24-s0-RGB565.c b/tests/hiz/hiz-depth-test-fbo-d24-s0-RGB565.c
new file mode 100644
index 0000000..6d99629
--- /dev/null
+++ b/tests/hiz/hiz-depth-test-fbo-d24-s0-RGB565.c
@@ -0,0 +1,68 @@
+/*
+ * Copyright © 2012 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.
+ */
+
+/**
+ * \file hiz-depth-test-fbo-d24-s0-RGB5.c
+ *
+ * Checks that depth tests work correctly when rendering to a window FBO with
+ * the following attachments:
+ *     - GL_COLOR_ATTACHMENT0: GL_RGB5
+ *     - GL_DEPTH_ATTACHMENT: GL_DEPTH_COMPONENT24
+ *
+ * (MESA_FORMAT_RGB565 and MESA_FORMAT_X8_Z24 gets selected in Mesa)
+ */
+
+#include "piglit-util-gl-common.h"
+#include "hiz/hiz-util.h"
+
+PIGLIT_GL_TEST_CONFIG_BEGIN
+
+	config.supports_gl_compat_version = 10;
+
+	config.window_width = 400;
+	config.window_height = 400;
+	config.window_visual = PIGLIT_GL_VISUAL_RGB;
+
+PIGLIT_GL_TEST_CONFIG_END
+
+struct hiz_fbo_options fbo_options = {
+	GL_RGB565,
+	GL_DEPTH_COMPONENT24,
+	0,
+	0,
+};
+
+void
+piglit_init(int argc, char **argv)
+{
+	/* empty */
+}
+
+enum piglit_result
+piglit_display()
+{
+	if (hiz_run_test_depth_test_fbo(&fbo_options))
+		return PIGLIT_PASS;
+	else
+		return PIGLIT_FAIL;
+}
-- 
1.7.10.4



More information about the Piglit mailing list