[Piglit] [PATCH 2/3] glslparsertest: Don't require ES compatibility extensions when testing GLES.
Paul Berry
stereotype441 at gmail.com
Thu Feb 14 11:14:38 PST 2013
glslparsertest should only check for the presence of
GL_ARB_ES{2,3}_compatibility when the test is running under desktop
GL. GLES never exposes these extensions.
---
tests/glslparsertest/glslparsertest.c | 36 ++++++++++++++++++++++++-----------
1 file changed, 25 insertions(+), 11 deletions(-)
diff --git a/tests/glslparsertest/glslparsertest.c b/tests/glslparsertest/glslparsertest.c
index cc37a35..14774e9 100644
--- a/tests/glslparsertest/glslparsertest.c
+++ b/tests/glslparsertest/glslparsertest.c
@@ -332,6 +332,30 @@ parse_glsl_version_string(const char *str)
return parse_glsl_version_number(str);
}
+
+static void
+check_version(unsigned glsl_version)
+{
+#ifdef PIGLIT_USE_OPENGL
+ if (requested_version == 100) {
+ piglit_require_extension("GL_ARB_ES2_compatibility");
+ return;
+ } else if (requested_version == 300) {
+ piglit_require_extension("GL_ARB_ES3_compatibility");
+ return;
+ }
+#endif
+
+ if (glsl_version < requested_version) {
+ fprintf(stderr,
+ "GLSL version is %u.%u, but requested version %u.%u is required\n",
+ glsl_version / 100, glsl_version % 100,
+ requested_version / 100, requested_version % 100);
+ piglit_report_result(PIGLIT_SKIP);
+ }
+}
+
+
void
piglit_init(int argc, char**argv)
{
@@ -372,17 +396,7 @@ piglit_init(int argc, char**argv)
if (glsl_version_string != NULL)
glsl_version = parse_glsl_version_string(glsl_version_string);
- if (requested_version == 100) {
- piglit_require_extension("GL_ARB_ES2_compatibility");
- } else if (requested_version == 300) {
- piglit_require_extension("GL_ARB_ES3_compatibility");
- } else if (glsl_version < requested_version) {
- fprintf(stderr,
- "GLSL version is %u.%u, but requested version %u.%u is required\n",
- glsl_version / 100, glsl_version % 100,
- requested_version / 100, requested_version % 100);
- piglit_report_result(PIGLIT_SKIP);
- }
+ check_version(glsl_version);
for (i = 4; i < argc; i++) {
if (argv[i][0] == '!')
--
1.8.1.3
More information about the Piglit
mailing list