[Piglit] [PATCH 3/5] util/gl: Support creation of debug contexts

Chad Versace chad.versace at linux.intel.com
Thu Oct 10 21:33:10 CEST 2013


Add a new boolean flag to the PIGLIT_GL_TEST_CONFIG block,
`config.require_debug_context`. If the test is unable to create a debug
context, then the test skips.

Signed-off-by: Chad Versace <chad.versace at linux.intel.com>
---
 tests/util/piglit-framework-gl.h                      | 8 ++++++++
 tests/util/piglit-framework-gl/piglit_wfl_framework.c | 5 +++++
 2 files changed, 13 insertions(+)

diff --git a/tests/util/piglit-framework-gl.h b/tests/util/piglit-framework-gl.h
index 0eef4b2..4dd0a9a 100644
--- a/tests/util/piglit-framework-gl.h
+++ b/tests/util/piglit-framework-gl.h
@@ -147,6 +147,14 @@ struct piglit_gl_test_config {
 	 */
 	bool require_forward_compatible_context;
 
+	/**
+	 * If true, then this test requires a debug context.
+	 *
+	 * Piglit will choose a waffle_config with WAFFLE_CONTEXT_DEBUG set to
+	 * true. If context creation fails, then the test skips.
+	 */
+	bool require_debug_context;
+
 	int window_width;
 	int window_height;
 	int window_samples;
diff --git a/tests/util/piglit-framework-gl/piglit_wfl_framework.c b/tests/util/piglit-framework-gl/piglit_wfl_framework.c
index a05049c..3f55d38 100644
--- a/tests/util/piglit-framework-gl/piglit_wfl_framework.c
+++ b/tests/util/piglit-framework-gl/piglit_wfl_framework.c
@@ -241,6 +241,11 @@ choose_config(struct piglit_wfl_framework *wfl_fw,
 		head_attrib_list[i++] = true;
 	}
 
+	if (test_config->require_debug_context) {
+		head_attrib_list[i++] = WAFFLE_CONTEXT_DEBUG;
+		head_attrib_list[i++] = true;
+	}
+
 	head_attrib_list[i++] = 0;
 	full_attrib_list = concat_attrib_lists(head_attrib_list,
 	                                       partial_attrib_list);
-- 
1.8.3.1



More information about the Piglit mailing list