[Piglit] [PATCH] util: do not compile/attach a NULL shader

Martin Peres martin.peres at linux.intel.com
Thu Mar 5 00:56:19 PST 2015


This will simplify greatly the code for an upcoming test

Signed-off-by: Martin Peres <martin.peres at linux.intel.com>
---
 tests/util/piglit-shader.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
 mode change 100644 => 100755 tests/util/piglit-shader.c

diff --git a/tests/util/piglit-shader.c b/tests/util/piglit-shader.c
old mode 100644
new mode 100755
index 37cc7cc..dfc2d92
--- a/tests/util/piglit-shader.c
+++ b/tests/util/piglit-shader.c
@@ -378,10 +378,14 @@ piglit_build_simple_program_unlinked_multiple_shaders_v(GLenum target1,
 	target = target1;
 
 	while (target != 0) {
-		GLuint shader = piglit_compile_shader_text(target, source);
+		/* do not compile/attach a NULL shader */
+		if (source) {
+			GLuint shader = piglit_compile_shader_text(target,
+								   source);
 
-		glAttachShader(prog, shader);
-		glDeleteShader(shader);
+			glAttachShader(prog, shader);
+			glDeleteShader(shader);
+		}
 
 		target  = va_arg(ap, GLenum);
 		if (target != 0)
-- 
2.3.1



More information about the Piglit mailing list