finderrors.c
branchtrunk
changeset 437 a97a9b21087b
parent 262 0f1531ac2578
child 450 6a9faf398c1d
--- a/finderrors.c	Wed Jul 30 05:11:15 2008 -0400
+++ b/finderrors.c	Thu Jul 31 17:43:38 2008 -0400
@@ -79,8 +79,20 @@
     if (shader == NULL)
         report("FAIL: %s %s\n", fname, MOJOSHADER_glGetError());
     else
-        report("PASS: %s\n", fname);
-    MOJOSHADER_glDeleteShader(shader);
+    {
+        const MOJOSHADER_parseData *pd = MOJOSHADER_glGetShaderParseData(shader);
+        MOJOSHADER_glShader *v = (pd->shader_type == MOJOSHADER_TYPE_VERTEX) ? shader : NULL;
+        MOJOSHADER_glShader *p = (pd->shader_type == MOJOSHADER_TYPE_PIXEL) ? shader : NULL;
+        MOJOSHADER_glProgram *program = MOJOSHADER_glLinkProgram(v, p);
+        if (program == NULL)
+            report("FAIL: %s %s\n", fname, MOJOSHADER_glGetError());
+        else
+        {
+            report("PASS: %s\n", fname);
+            MOJOSHADER_glDeleteProgram(program);
+        } // else
+        MOJOSHADER_glDeleteShader(shader);
+    }
     #else
     const MOJOSHADER_parseData *pd = MOJOSHADER_parse(profile, buf, rc, 0, 0, 0);
     if (pd->error != NULL)