summaryrefslogtreecommitdiff
path: root/tests/glslparsertest
diff options
context:
space:
mode:
authorPaul Berry <stereotype441@gmail.com>2013-02-08 13:04:13 -0800
committerPaul Berry <stereotype441@gmail.com>2013-02-15 13:16:47 -0800
commit3a92ffa0eb1efff8ccbe65b5c51710cea8ef0c5c (patch)
tree8a28b19522fd405c8b367578872da53ea746e6a7 /tests/glslparsertest
parentee5e37da492b1ab67bcd0a966474f6b70dce05b4 (diff)
shader_runner and glslparsertest: choose GL version more accurately.
Previously, both shader_runner and glslparsertest contained switch statements that attempted to choose a GL version for testing based on a GLSL version requirement, and those switch statements didn't choose a GL version very accurately (for example, they converted GLSL version 1.50 to GL version 3.1, which doesn't work). This patch replaces the switch statements with a single common function (in piglit-util-gl-common) that does the right thing. Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Diffstat (limited to 'tests/glslparsertest')
-rw-r--r--tests/glslparsertest/glslparsertest.c36
1 files changed, 14 insertions, 22 deletions
diff --git a/tests/glslparsertest/glslparsertest.c b/tests/glslparsertest/glslparsertest.c
index ff32da799..14998c067 100644
--- a/tests/glslparsertest/glslparsertest.c
+++ b/tests/glslparsertest/glslparsertest.c
@@ -41,32 +41,24 @@ PIGLIT_GL_TEST_CONFIG_BEGIN
if (argc > 3) {
const unsigned int int_version = parse_glsl_version(argv[3]);
-
switch (int_version) {
- case 110:
- case 120:
- case 130:
+ case 100:
config.supports_gl_compat_version = 10;
- config.supports_gl_core_version = 0;
- config.supports_gl_es_version = 0;
- break;
- case 140:
- case 150:
- case 330:
- config.supports_gl_compat_version = 31;
- config.supports_gl_core_version = 31;
- config.supports_gl_es_version = 0;
- break;
- case 400:
- case 410:
- case 420:
- config.supports_gl_compat_version = 40;
- config.supports_gl_core_version = 40;
- config.supports_gl_es_version = 0;
+ config.supports_gl_es_version = 20;
break;
- default:
+ case 300:
config.supports_gl_compat_version = 10;
- config.supports_gl_es_version = 20;
+ config.supports_gl_es_version = 30;
+ break;
+ default: {
+ const unsigned int gl_version
+ = required_gl_version_from_glsl_version(int_version);
+ config.supports_gl_compat_version = gl_version;
+ if (gl_version < 31)
+ config.supports_gl_core_version = 0;
+ else
+ config.supports_gl_core_version = gl_version;
+ }
break;
}
} else {