[Piglit] [PATCH 6/6] utils/wfl: do not use OpenGL 3.0 features only when needed

Emil Velikov emil.l.velikov at gmail.com
Tue Mar 29 22:45:01 UTC 2016


If the requested version is we should not set the version/debug flag.
The latter two indicate the presence of ARB_create_context winsys
extensions, which are unlikely to be present if the driver does not
support OpenGL 3.0.

Cc: Brian Paul <brianp at vmware.com>
Cc: Ilia Mirkin <imirkin at alum.mit.edu>
Cc: Jose Fonseca <jfoneca at vmware.com>
Signed-off-by: Emil Velikov <emil.l.velikov at gmail.com>
---
 tests/util/piglit-framework-gl/piglit_wfl_framework.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/tests/util/piglit-framework-gl/piglit_wfl_framework.c b/tests/util/piglit-framework-gl/piglit_wfl_framework.c
index cb8514e..441a744 100644
--- a/tests/util/piglit-framework-gl/piglit_wfl_framework.c
+++ b/tests/util/piglit-framework-gl/piglit_wfl_framework.c
@@ -238,6 +238,16 @@ parse_test_config(const struct piglit_gl_test_config *test_config,
 				head_attrib_list[i++] = WAFFLE_CONTEXT_COMPATIBILITY_PROFILE;
 			}
 
+			/* Do not explicitly request the version if it's lower
+			 * than 3.0. OpenGL 3.0 comes along with the winsys
+			 * extensions *ARB_create_context. If the extension
+			 * is not available (likely most/all pre 3.0 drivers),
+			 * Waffle will fail.
+			 */
+			if (test_config->supports_gl_compat_version < 30) {
+				break;
+			}
+
 			major_version = test_config->supports_gl_compat_version / 10;
 			head_attrib_list[i++] = WAFFLE_CONTEXT_MAJOR_VERSION;
 			head_attrib_list[i++] = major_version;
@@ -300,7 +310,9 @@ parse_test_config(const struct piglit_gl_test_config *test_config,
 		head_attrib_list[i++] = true;
 	}
 
-	if (test_config->require_debug_context) {
+	if (test_config->require_debug_context &&
+	    (flavor != CONTEXT_GL_COMPAT ||
+	     test_config->supports_gl_compat_version >= 30)) {
 		debug_str = "Debug ";
 
 		head_attrib_list[i++] = WAFFLE_CONTEXT_DEBUG;
-- 
2.6.2



More information about the Piglit mailing list