aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStuart Abercrombie <sabercrombie@chromium.org>2013-01-15 19:25:35 -0800
committerChad Versace <chad.versace@linux.intel.com>2013-01-16 12:54:28 -0800
commitdadf56dad25730556e36e9446aabfc80458cc12f (patch)
tree6532a8563b0500cbff4a57c704833c53a0ae0e9e
parent321c0f467179b8e410d8b74d3805f900045f487d (diff)
shader_runner: Alter GL/GLSL ES version requirement syntax.
The current syntax isn't compatible with the same shader_test supporting GL and GLES in the future. Modify existing GL ES tests to use the new syntax, and remove explicit #version directives, which will instead be inserted based on GLSL >= requirements. v2 Added check for trailing chars. Formatting. Reviewed-by: Chad Versace <chad.versace@linux.intel.com> Reviewed-by: Tom Gall <tom.gall@linaro.org>
-rw-r--r--tests/shaders/shader_runner.c24
-rw-r--r--tests/spec/glsl-es-1.00/execution/sanity.shader_test7
-rw-r--r--tests/spec/glsl-es-3.00/execution/sanity.shader_test8
3 files changed, 15 insertions, 24 deletions
diff --git a/tests/shaders/shader_runner.c b/tests/shaders/shader_runner.c
index db92b8f8..8dfeb2a8 100644
--- a/tests/shaders/shader_runner.c
+++ b/tests/shaders/shader_runner.c
@@ -459,15 +459,8 @@ process_comparison(const char *src, enum comparison *cmp)
/**
- * To specify an ES version, append "es" to the version. For example:
- * GL >= 3.0 es
- * GLSL >= 3.00 es
- *
- * GLSL ES 1.00 is a special case. Despite being an ES shading language,
- * the #version directive lacks "es"; that is, the directive is
- * `#version 100` rather than `#version 100 es`. Therefore be lenient in
- * parsing that version. Interpret `GLSL >= 100` and `GLSL >= 100 es`
- * identically.
+ * " ES" before the comparison operator indicates the version
+ * pertains to GL ES.
*/
void
parse_version_comparison(const char *line, enum comparison *cmp,
@@ -476,8 +469,12 @@ parse_version_comparison(const char *line, enum comparison *cmp,
unsigned major;
unsigned minor;
unsigned full_num;
- bool es;
+ bool es = false;
+ if (string_match(" ES", line)) {
+ es = true;
+ line += 3;
+ }
line = eat_whitespace(line);
line = process_comparison(line, cmp);
@@ -486,7 +483,10 @@ parse_version_comparison(const char *line, enum comparison *cmp,
line = eat_text(line);
line = eat_whitespace(line);
- es = string_match("es", line);
+ if (*line != '\n') {
+ printf("Unexpected characters following version comparison\n");
+ piglit_report_result(PIGLIT_FAIL);
+ }
/* This hack is so that we can tell the difference between GL versions
* and GLSL versions. All GL versions look like 3.2, and we want the
@@ -495,8 +495,6 @@ parse_version_comparison(const char *line, enum comparison *cmp,
*/
if (tag == VERSION_GLSL) {
full_num = (major * 100) + minor;
- if (full_num == 100)
- es = true;
} else {
full_num = (major * 10) + minor;
}
diff --git a/tests/spec/glsl-es-1.00/execution/sanity.shader_test b/tests/spec/glsl-es-1.00/execution/sanity.shader_test
index a1dc07a0..0884e2c6 100644
--- a/tests/spec/glsl-es-1.00/execution/sanity.shader_test
+++ b/tests/spec/glsl-es-1.00/execution/sanity.shader_test
@@ -1,11 +1,10 @@
# Fill the window with red, then green, then blue.
[require]
-GL >= 2.0 es
+GL ES >= 2.0
+GLSL ES >= 1.00
[vertex shader]
-#version 100
-
attribute vec4 vertex;
void main() {
@@ -13,8 +12,6 @@ void main() {
}
[fragment shader]
-#version 100
-
uniform vec4 u_color;
void main() {
diff --git a/tests/spec/glsl-es-3.00/execution/sanity.shader_test b/tests/spec/glsl-es-3.00/execution/sanity.shader_test
index e7e6dedf..1709d78e 100644
--- a/tests/spec/glsl-es-3.00/execution/sanity.shader_test
+++ b/tests/spec/glsl-es-3.00/execution/sanity.shader_test
@@ -1,12 +1,10 @@
# Fill the window with red, then green, then blue.
[require]
-GL >= 3.0 es
-GLSL >= 3.00 es
+GL ES >= 3.0
+GLSL ES >= 3.00
[vertex shader]
-#version 300 es
-
in vec4 vertex;
void main() {
@@ -14,8 +12,6 @@ void main() {
}
[fragment shader]
-#version 300 es
-
uniform vec4 u_color;
out vec4 color;