Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Also link programs when testing for shader compile errors.
--HG--
branch : trunk
  • Loading branch information
icculus committed Jul 31, 2008
1 parent 252f800 commit 3bb0c36
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions finderrors.c
Expand Up @@ -79,8 +79,20 @@ static int do_file(const char *profile, const char *dname, const char *fn, int *
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)
Expand Down

0 comments on commit 3bb0c36

Please sign in to comment.