[Piglit] [PATCH 6/8] util/gl: Support creation of debug contexts
Chad Versace
chad.versace at linux.intel.com
Thu Dec 19 18:12:37 PST 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 ++++++++
.../util/piglit-framework-gl/piglit_wfl_framework.c | 21 +++++++++++++++++----
2 files changed, 25 insertions(+), 4 deletions(-)
diff --git a/tests/util/piglit-framework-gl.h b/tests/util/piglit-framework-gl.h
index 1f9831e..d8485b3 100644
--- a/tests/util/piglit-framework-gl.h
+++ b/tests/util/piglit-framework-gl.h
@@ -172,6 +172,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 7ab74bd..b5c2b0c 100644
--- a/tests/util/piglit-framework-gl/piglit_wfl_framework.c
+++ b/tests/util/piglit-framework-gl/piglit_wfl_framework.c
@@ -151,8 +151,9 @@ static void
make_context_description(char buf[], size_t bufsize, const int32_t attrib_list[])
{
int32_t api = 0, profile = 0, major_version = 0, minor_version = 0,
- fwd_compat = 0;
- const char *api_str = NULL, *profile_str = NULL, *fwd_compat_str = NULL;
+ fwd_compat = 0, debug = 0;
+ const char *api_str = NULL, *profile_str = NULL, *fwd_compat_str = NULL,
+ *debug_str = NULL;
if (bufsize == 0) {
return;
@@ -163,6 +164,7 @@ make_context_description(char buf[], size_t bufsize, const int32_t attrib_list[]
waffle_attrib_list_get(attrib_list, WAFFLE_CONTEXT_MAJOR_VERSION, &major_version);
waffle_attrib_list_get(attrib_list, WAFFLE_CONTEXT_MINOR_VERSION, &minor_version);
waffle_attrib_list_get(attrib_list, WAFFLE_CONTEXT_FORWARD_COMPATIBLE, &fwd_compat);
+ waffle_attrib_list_get(attrib_list, WAFFLE_CONTEXT_DEBUG, &debug);
switch (api) {
case WAFFLE_CONTEXT_OPENGL:
@@ -199,9 +201,15 @@ make_context_description(char buf[], size_t bufsize, const int32_t attrib_list[]
fwd_compat_str = "";
}
- snprintf(buf, bufsize, "%s %d.%d %s%sContext",
+ if (debug) {
+ debug_str = "Debug ";
+ } else {
+ debug_str = "";
+ }
+
+ snprintf(buf, bufsize, "%s %d.%d %s%s%sContext",
api_str, major_version, minor_version, fwd_compat_str,
- profile_str);
+ profile_str, debug_str);
}
/**
@@ -309,6 +317,11 @@ make_config_attrib_list(const struct piglit_gl_test_config *test_config,
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;
return concat_attrib_lists(head_attrib_list, partial_attrib_list);
}
--
1.8.4
More information about the Piglit
mailing list