aboutsummaryrefslogtreecommitdiff
path: root/tests/util
diff options
context:
space:
mode:
authorChad Versace <chad.versace@linux.intel.com>2012-11-15 07:59:25 -0800
committerChad Versace <chad.versace@linux.intel.com>2012-11-29 17:08:01 -0800
commit0c7596b068b9642afb9510537932eff8d32409e8 (patch)
treea2c461e59959b47263465b70aaf05da58829c819 /tests/util
parent21bc049656dcf18adcc23ece28a4c186dffbf380 (diff)
util/gl: Add config field 'supports_gl_es_version'
This field allows a test to declare support for any GLES version. It replaces fields 'supports_gl_es1' and 'supports_gl_es2'. The valid range for the field is currently [1.0, 3.0), though it will soon get bumped to [1.0,4.0). One advantage of this field is that it introduces symmetry among the 'supports_gl' fields. Before this patch, two fields were integers (supports_gl_core_version, supports_gl_compat_version) and two were booleans (supports_gl_es1, supports_gl_es2). Now they're all integers and behave similarly. This patch also updates, with the substitution below, the tests that used the old config fields. supports_gl_es2 = true --> supports_gl_es_version = 20 supports_gl_es1 = true --> supports_gl_es_version = 10 Signed-off-by: Chad Versace <chad.versace@linux.intel.com> Reviewed-by: Eric Anholt <eric@anholt.net>
Diffstat (limited to 'tests/util')
-rw-r--r--tests/util/piglit-framework-gl.h28
-rw-r--r--tests/util/piglit-framework-gl/piglit_gl_framework.c11
-rw-r--r--tests/util/piglit-framework-gl/piglit_wfl_framework.c53
3 files changed, 48 insertions, 44 deletions
diff --git a/tests/util/piglit-framework-gl.h b/tests/util/piglit-framework-gl.h
index 4dd60ded..6ab791a3 100644
--- a/tests/util/piglit-framework-gl.h
+++ b/tests/util/piglit-framework-gl.h
@@ -73,6 +73,24 @@ enum piglit_gl_visual {
*/
struct piglit_gl_test_config {
/**
+ * If this field is non-zero, then the test is able to run under any
+ * OpenGL ES context whose version is backwards-compatible with the
+ * given version.
+ *
+ * For example, if this field's value is '10', then Piglit will
+ * attempt to run the test under an OpenGL ES 1.0 context. Likewise
+ * for '20' and OpenGL ES 2.0.
+ *
+ * If Piglit fails to acquire the waffle_config or to create the
+ * waffle_context, then it skips its attempt to run the test under
+ * an OpenGL ES context.
+ *
+ * If this field is 0, then the test is not able to run under an
+ * OpenGL ES context of any version.
+ */
+ int supports_gl_es_version;
+
+ /**
* If this field is non-zero, then the test is able to run under a GL
* core context having at least the given version.
*
@@ -141,16 +159,6 @@ struct piglit_gl_test_config {
*/
int supports_gl_compat_version;
- /**
- * The test is able to run under an OpenGL ES1 context.
- */
- bool supports_gl_es1;
-
- /**
- * The test is able to run under an OpenGL ES2 context.
- */
- bool supports_gl_es2;
-
int window_width;
int window_height;
diff --git a/tests/util/piglit-framework-gl/piglit_gl_framework.c b/tests/util/piglit-framework-gl/piglit_gl_framework.c
index aa6884bc..aa24dd7a 100644
--- a/tests/util/piglit-framework-gl/piglit_gl_framework.c
+++ b/tests/util/piglit-framework-gl/piglit_gl_framework.c
@@ -61,8 +61,7 @@ validate_supported_apis(const struct piglit_gl_test_config *test_config)
{
if (!test_config->supports_gl_core_version &&
!test_config->supports_gl_compat_version &&
- !test_config->supports_gl_es1 &&
- !test_config->supports_gl_es2) {
+ !test_config->supports_gl_es_version) {
printf("The test config supports no GL API's.\n");
piglit_report_result(PIGLIT_FAIL);
}
@@ -80,12 +79,8 @@ validate_supported_apis(const struct piglit_gl_test_config *test_config)
&& !test_config->supports_gl_compat_version) {
piglit_report_result(PIGLIT_SKIP);
}
-#elif defined(PIGLIT_USE_OPENGL_ES1)
- if (!test_config->supports_gl_es1) {
- piglit_report_result(PIGLIT_SKIP);
- }
-#elif defined(PIGLIT_USE_OPENGL_ES2)
- if (!test_config->supports_gl_es2) {
+#elif defined(PIGLIT_USE_OPENGL_ES1) || defined(PIGLIT_USE_OPENGL_ES2)
+ if (!test_config->supports_gl_es_version) {
piglit_report_result(PIGLIT_SKIP);
}
#else
diff --git a/tests/util/piglit-framework-gl/piglit_wfl_framework.c b/tests/util/piglit-framework-gl/piglit_wfl_framework.c
index eb117b5b..9f07f7e8 100644
--- a/tests/util/piglit-framework-gl/piglit_wfl_framework.c
+++ b/tests/util/piglit-framework-gl/piglit_wfl_framework.c
@@ -31,8 +31,7 @@
enum context_flavor {
CONTEXT_GL_CORE,
CONTEXT_GL_COMPAT,
- CONTEXT_GL_ES1,
- CONTEXT_GL_ES2,
+ CONTEXT_GL_ES,
};
struct piglit_wfl_framework*
@@ -197,23 +196,34 @@ choose_config(struct piglit_wfl_framework *wfl_fw,
head_attrib_list[i++] = 0;
break;
- case CONTEXT_GL_ES1:
- assert(test_config->supports_gl_es1);
-
- i = 0;
- head_attrib_list[i++] = WAFFLE_CONTEXT_API;
- head_attrib_list[i++] = WAFFLE_CONTEXT_OPENGL_ES1;
- head_attrib_list[i++] = 0;
- break;
-
- case CONTEXT_GL_ES2:
- assert(test_config->supports_gl_es2);
+ case CONTEXT_GL_ES: {
+ int32_t waffle_context_api;
+ assert(test_config->supports_gl_es_version);
+
+ if (test_config->supports_gl_es_version >= 30) {
+ printf("piglit: info: piglit does not yet "
+ "support OpenGL ES %d.%d\n",
+ test_config->supports_gl_es_version / 10,
+ test_config->supports_gl_es_version % 10);
+ piglit_report_result(PIGLIT_SKIP);
+ } else if (test_config->supports_gl_es_version >= 20) {
+ waffle_context_api = WAFFLE_CONTEXT_OPENGL_ES2;
+ } else if (test_config->supports_gl_es_version >= 10) {
+ waffle_context_api = WAFFLE_CONTEXT_OPENGL_ES1;
+ } else {
+ printf("piglit: error: config attribute "
+ "'supports_gl_es_version' has "
+ "bad value %d\n",
+ test_config->supports_gl_es_version);
+ piglit_report_result(PIGLIT_FAIL);
+ }
i = 0;
head_attrib_list[i++] = WAFFLE_CONTEXT_API;
- head_attrib_list[i++] = WAFFLE_CONTEXT_OPENGL_ES2;
+ head_attrib_list[i++] = waffle_context_api;
head_attrib_list[i++] = 0;
break;
+ }
default:
assert(0);
@@ -360,25 +370,16 @@ make_context_current(struct piglit_wfl_framework *wfl_fw,
}
}
-#elif defined(PIGLIT_USE_OPENGL_ES1)
+#elif defined(PIGLIT_USE_OPENGL_ES1) || defined(PIGLIT_USE_OPENGL_ES2)
ok = make_context_current_singlepass(wfl_fw, test_config,
- CONTEXT_GL_ES1,
+ CONTEXT_GL_ES,
partial_config_attrib_list);
if (ok)
return;
else
- printf("piglit: info: Failed to create GL ES1 context\n");
-
-#elif defined(PIGLIT_USE_OPENGL_ES2)
- ok = make_context_current_singlepass(wfl_fw, test_config,
- CONTEXT_GL_ES2,
- partial_config_attrib_list);
+ printf("piglit: info: Failed to create GL ES context\n");
- if (ok)
- return;
- else
- printf("piglit: info: Failed to create GL ES2 context\n");
#else
# error
#endif