[Piglit] [PATCH 8/9] util/wfl: Remove hacks for compat contexts
Chad Versace
chad.versace at linux.intel.com
Mon Dec 30 16:08:35 PST 2013
When a test requested a compatibility context, Piglit did not pass the
context version to Waffle. Instead, Piglit requested an unversioned
compatibility context and then verified with piglit_get_gl_version()
that the actual version was >= requested version.
This hack prevented Piglit from creating forward-compatible contexts,
because, according to thw EGL_KHR_create_context spec, "requesting
a forward-compatible context for OpenGL versions less than
3.0 will generate an error."
Remove the hack. Pass the requested context version to Waffle.
Signed-off-by: Chad Versace <chad.versace at linux.intel.com>
---
.../piglit-framework-gl/piglit_wfl_framework.c | 23 ++++++----------------
1 file changed, 6 insertions(+), 17 deletions(-)
diff --git a/tests/util/piglit-framework-gl/piglit_wfl_framework.c b/tests/util/piglit-framework-gl/piglit_wfl_framework.c
index b5c2b0c..0d09032 100644
--- a/tests/util/piglit-framework-gl/piglit_wfl_framework.c
+++ b/tests/util/piglit-framework-gl/piglit_wfl_framework.c
@@ -260,22 +260,15 @@ make_config_attrib_list(const struct piglit_gl_test_config *test_config,
case CONTEXT_GL_COMPAT:
assert(test_config->supports_gl_compat_version);
- /* Don't supply a GL version to Waffle. When no
- * version is specified, GLX and EGL should return the
- * latest supported version. Later, we compare the
- * actual version, as reported by glGetString, against
- * the version required by the test.
- *
- * If a version != 1.0 is given to
- * waffle_choose_config, then a code path in waffle is
- * taken that requires GLX_ARB_create_context or
- * EGL_KHR_create_context. This trick enables tests
- * for which supports_gl_compat_version > 1.0 to run
- * on drivers that lack those extensions.
- */
i = 0;
head_attrib_list[i++] = WAFFLE_CONTEXT_API;
head_attrib_list[i++] = WAFFLE_CONTEXT_OPENGL;
+
+ head_attrib_list[i++] = WAFFLE_CONTEXT_MAJOR_VERSION;
+ head_attrib_list[i++] = test_config->supports_gl_compat_version / 10;
+
+ head_attrib_list[i++] = WAFFLE_CONTEXT_MINOR_VERSION;
+ head_attrib_list[i++] = test_config->supports_gl_compat_version % 10;
break;
case CONTEXT_GL_ES: {
@@ -344,10 +337,6 @@ check_gl_version(const struct piglit_gl_test_config *test_config,
*/
return true;
case CONTEXT_GL_COMPAT: {
- /* Piglit did not supply a version to
- * waffle_config_choose(). We must check the context's
- * actual version.
- */
int actual_version = piglit_get_gl_version();
if (actual_version >= test_config->supports_gl_compat_version)
return true;
--
1.8.4
More information about the Piglit
mailing list