mesa: when linking a shader program, make sure all the shaders compiled OK
authorBrian Paul <brian.paul@tungstengraphics.com>
Wed, 2 Jul 2008 23:08:47 +0000 (17:08 -0600)
committerBrian Paul <brian.paul@tungstengraphics.com>
Wed, 2 Jul 2008 23:08:47 +0000 (17:08 -0600)
cherry-picked from master

src/mesa/shader/slang/slang_link.c

index dd4990ba023605be51100f21c4feffcab2396237..f08b53e8b74e34b20cdb098385a35b5e98296eb5 100644 (file)
@@ -388,6 +388,14 @@ _slang_link(GLcontext *ctx,
 
    _mesa_clear_shader_program_data(ctx, shProg);
 
+   /* check that all programs compiled successfully */
+   for (i = 0; i < shProg->NumShaders; i++) {
+      if (!shProg->Shaders[i]->CompileStatus) {
+         link_error(shProg, "linking with uncompiled shader\n");
+         return;
+      }
+   }
+
    shProg->Uniforms = _mesa_new_uniform_list();
    shProg->Varying = _mesa_new_parameter_list();