[Piglit] [PATCH 1/4] glslparsertest: Add complementary shaders to link GLSL ES 3.00 shaders too

Ian Romanick idr at freedesktop.org
Fri Aug 9 15:40:06 PDT 2013


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

Fixes failures in ES3 --check-link tests
default-precision-sampler.frag and default-precision-sampler.vert.  It
also makes "glsl-es-3.00 compiler no-default-float-precision.frag"
correctly fail.

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

diff --git a/tests/glslparsertest/glslparsertest.c b/tests/glslparsertest/glslparsertest.c
index bba6cb3..d9f1947 100644
--- a/tests/glslparsertest/glslparsertest.c
+++ b/tests/glslparsertest/glslparsertest.c
@@ -134,12 +134,12 @@ attach_dummy_shader(GLuint shader_prog, GLenum type)
 	switch (type) {
 	case GL_VERTEX_SHADER:
 		shader_template =
-			"#version %d\n"
+			"#version %d %s\n"
 			"void main() { gl_Position = vec4(0.0); }";
 		break;
 	case GL_FRAGMENT_SHADER:
 		shader_template =
-			"#version %d\n"
+			"#version %d %s\n"
 			"void main() { }";
 		break;
 	default:
@@ -148,7 +148,10 @@ attach_dummy_shader(GLuint shader_prog, GLenum type)
 		break;
 	}
 
-	sprintf(shader_text, shader_template, requested_version);
+	sprintf(shader_text,
+		shader_template,
+		requested_version,
+		(requested_version == 300) ? "es" : "");
 	shader = piglit_compile_shader_text(type, shader_text);
 	glAttachShader(shader_prog, shader);
 }
@@ -242,7 +245,7 @@ test(void)
 
 		shader_prog = glCreateProgram();
 		glAttachShader(shader_prog, prog);
-		if (requested_version == 100)
+		if (requested_version == 100 || requested_version == 300)
 			attach_complementary_shader(shader_prog, type);
 #if PIGLIT_USE_OPENGL
 		if (type == GL_GEOMETRY_SHADER)
-- 
1.8.1.4



More information about the Piglit mailing list