mesa: glsl: additional error checking
authorBrian Paul <brian.paul@tungstengraphics.com>
Wed, 6 Aug 2008 22:29:10 +0000 (16:29 -0600)
committerBrian Paul <brian.paul@tungstengraphics.com>
Wed, 6 Aug 2008 22:29:10 +0000 (16:29 -0600)
src/mesa/shader/slang/slang_link.c

index 53de4232bea7b43d5c03ec3f70a8c7ead8687253..8f07406ee49822b97ee97ccbf6cef630a009cf5c 100644 (file)
@@ -445,6 +445,18 @@ _slang_link(GLcontext *ctx,
          _mesa_problem(ctx, "unexpected shader target in slang_link()");
    }
 
+#if FEATURE_es2_glsl
+   /* must have both a vertex and fragment program for ES2 */
+   if (!vertProg) {
+      link_error(shProg, "missing vertex shader\n");
+      return;
+   }
+   if (!fragProg) {
+      link_error(shProg, "missing fragment shader\n");
+      return;
+   }
+#endif
+
    /*
     * Make copies of the vertex/fragment programs now since we'll be
     * changing src/dst registers after merging the uniforms and varying vars.