summaryrefslogtreecommitdiff
path: root/tests/glslparsertest/glslparsertest.c
diff options
context:
space:
mode:
authorIan Romanick <ian.d.romanick@intel.com>2012-11-09 18:10:10 -0800
committerIan Romanick <ian.d.romanick@intel.com>2012-11-16 16:07:02 -0800
commit6d9c5d6c92f8bc3f9728dc8fdda2ffecc8cd0d5c (patch)
tree410316f4c8c21d7e45f8497caffd52485fe6f919 /tests/glslparsertest/glslparsertest.c
parent6771c5a0a17421693355ff40d9fd97e30e37ecb6 (diff)
glslparsertest: Use specified GLSL version to select API version
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Eric Anholt <eric@anholt.net>
Diffstat (limited to 'tests/glslparsertest/glslparsertest.c')
-rw-r--r--tests/glslparsertest/glslparsertest.c37
1 files changed, 35 insertions, 2 deletions
diff --git a/tests/glslparsertest/glslparsertest.c b/tests/glslparsertest/glslparsertest.c
index d2e470899..8d630e965 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;