[Piglit] [PATCH] Handle OpenGL ES-CM 1.x strings in piglit_get_gl_version

Matt Turner mattst88 at gmail.com
Fri Jul 27 08:09:05 PDT 2012


Otherwise, piglit would fail to parse the version string and report a
failure if glGetString(GL_VERSION) were called in an ES 1.x context.

I'm not sure why we need this check at all and can't just eat characters
while(!isdigit(*c) && *c != NULL).
---
The piglit_is_gles() function immediately above won't handle GLESv1 either
but I'll leave that for later.

 tests/util/piglit-util-gl-common.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/tests/util/piglit-util-gl-common.c b/tests/util/piglit-util-gl-common.c
index 661fae0..2989efb 100644
--- a/tests/util/piglit-util-gl-common.c
+++ b/tests/util/piglit-util-gl-common.c
@@ -39,8 +39,13 @@ int piglit_get_gl_version()
 	int minor;
 
 	/* skip to version number */
-	if (strncmp("OpenGL ES ", version_string, 10) == 0)
-		version_number_string = version_string + 10;
+	if (strncmp("OpenGL ES", version_string, 9) == 0) {
+		if (strncmp("-CM ", version_string + 9, 4) == 0) {
+			version_number_string = version_string + 13;
+		} else {
+			version_number_string = version_string + 10;
+		}
+	}
 	else
 		version_number_string = version_string;
 
-- 
1.7.8.6



More information about the Piglit mailing list