[Piglit] [PATCH 5/5] glslparsertest: Use specified GLSL version to select API version

Ian Romanick idr at freedesktop.org
Tue Nov 13 17:00:22 PST 2012


From: Ian Romanick <ian.d.romanick at intel.com>

Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
---
 tests/glslparsertest/glslparsertest.c | 37 +++++++++++++++++++++++++++++++++--
 1 file changed, 35 insertions(+), 2 deletions(-)

diff --git a/tests/glslparsertest/glslparsertest.c b/tests/glslparsertest/glslparsertest.c
index d2e4708..8d630e9 100644
--- a/tests/glslparsertest/glslparsertest.c
+++ b/tests/glslparsertest/glslparsertest.c
@@ -37,8 +37,41 @@
 
 PIGLIT_GL_TEST_CONFIG_BEGIN
 
-	config.supports_gl_compat_version = 10;
-	config.supports_gl_es2 = true;
+	if (argc > 3) {
+		const float version = strtod(argv[3], NULL);
+		const unsigned int int_version = (unsigned) (version * 10);
+
+		switch (int_version) {
+		case 11:
+		case 12:
+		case 13:
+			config.supports_gl_compat_version = 10;
+			config.supports_gl_core_version = 0;
+			config.supports_gl_es2 = false;
+			break;
+		case 14:
+		case 15:
+		case 33:
+			config.supports_gl_compat_version = 31;
+			config.supports_gl_core_version = 31;
+			config.supports_gl_es2 = false;
+			break;
+		case 40:
+		case 41:
+		case 42:
+			config.supports_gl_compat_version = 40;
+			config.supports_gl_core_version = 40;
+			config.supports_gl_es2 = false;
+			break;
+		default:
+			config.supports_gl_compat_version = 10;
+			config.supports_gl_es2 = true;
+			break;
+		}
+	} else {
+		config.supports_gl_compat_version = 10;
+		config.supports_gl_es2 = true;
+	}
 
 	config.window_width = 200;
 	config.window_height = 100;
-- 
1.7.11.7



More information about the Piglit mailing list