Add a new boolean flag to the PIGLIT_GL_TEST_CONFIG block,
`config.require_forward_compatible_context`. If the test is unable to
create a foward-compatible context, then the test skips.

Signed-off-by: Chad Versace <[email protected]>
---
 tests/util/piglit-framework-gl.h                      |  9 +++++++++
 tests/util/piglit-framework-gl/piglit_wfl_framework.c | 10 ++++++----
 2 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/tests/util/piglit-framework-gl.h b/tests/util/piglit-framework-gl.h
index 7520f38..0eef4b2 100644
--- a/tests/util/piglit-framework-gl.h
+++ b/tests/util/piglit-framework-gl.h
@@ -138,6 +138,15 @@ struct piglit_gl_test_config {
         */
        int supports_gl_compat_version;
 
+       /**
+        * If true, then this test requires a forward-compatible context.
+        *
+        * Piglit will choose a waffle_config with
+        * WAFFLE_CONTEXT_FORWARD_COMPATIBLE set to true. If context creation
+        * fails, then the test skips.
+        */
+       bool require_forward_compatible_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 d8cb944..a05049c 100644
--- a/tests/util/piglit-framework-gl/piglit_wfl_framework.c
+++ b/tests/util/piglit-framework-gl/piglit_wfl_framework.c
@@ -179,8 +179,6 @@ choose_config(struct piglit_wfl_framework *wfl_fw,
 
                        head_attrib_list[i++] = WAFFLE_CONTEXT_MINOR_VERSION;
                        head_attrib_list[i++] = 
test_config->supports_gl_core_version % 10;
-
-                       head_attrib_list[i++] = 0;
                        break;
 
                case CONTEXT_GL_COMPAT:
@@ -202,7 +200,6 @@ choose_config(struct piglit_wfl_framework *wfl_fw,
                        i = 0;
                        head_attrib_list[i++] = WAFFLE_CONTEXT_API;
                        head_attrib_list[i++] = WAFFLE_CONTEXT_OPENGL;
-                       head_attrib_list[i++] = 0;
                        break;
 
                case CONTEXT_GL_ES: {
@@ -231,7 +228,6 @@ choose_config(struct piglit_wfl_framework *wfl_fw,
                        head_attrib_list[i++] = 
test_config->supports_gl_es_version / 10;
                        head_attrib_list[i++] = WAFFLE_CONTEXT_MINOR_VERSION;
                        head_attrib_list[i++] = 
test_config->supports_gl_es_version % 10;
-                       head_attrib_list[i++] = 0;
                        break;
                        }
 
@@ -240,6 +236,12 @@ choose_config(struct piglit_wfl_framework *wfl_fw,
                        break;
        }
 
+       if (test_config->require_forward_compatible_context) {
+               head_attrib_list[i++] = WAFFLE_CONTEXT_FORWARD_COMPATIBLE;
+               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

_______________________________________________
Piglit mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/piglit

Reply via email to