[Piglit] [PATCH 2/2] shader_runner: Require GLSL version requirement.

Stuart Abercrombie sabercrombie at chromium.org
Wed Feb 6 17:04:26 PST 2013


A step towards removing explicit #version directives.

This time the check is in compile_glsl.
ARB program tests are unaffected.

Signed-off-by: Stuart Abercrombie <sabercrombie at chromium.org>
---
 tests/shaders/shader_runner.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/tests/shaders/shader_runner.c b/tests/shaders/shader_runner.c
index eab48f3..0ae9e0c 100644
--- a/tests/shaders/shader_runner.c
+++ b/tests/shaders/shader_runner.c
@@ -203,8 +203,12 @@ compile_glsl(GLenum target, bool release_text)
 		break;
 	}
 
-	if (glsl_req_version.num != 0 &&
-	    !strstr(shader_string, "#version ")) {
+	if (!glsl_req_version.num) {
+		printf("GLSL version requirement missing\n");
+		piglit_report_result(PIGLIT_FAIL);
+	}
+
+	if (!strstr(shader_string, "#version ")) {
 		char *shader_strings[2];
 		char version_string[100];
 		GLint shader_string_sizes[2];
-- 
1.8.1



More information about the Piglit mailing list