diff options
author | Brian <brian@yutani.localnet.net> | 2007-04-18 15:22:43 -0600 |
---|---|---|
committer | Brian <brian@yutani.localnet.net> | 2007-04-18 17:14:13 -0600 |
commit | aaa57412c1a682730f27f08bd89a79b8b81f982f (patch) | |
tree | e973ee54c0ab778409613e3c243a75a78f0e1817 /src/mesa/shader | |
parent | 2a2f8d806f74619f0a7cf97fdc7f7b3ad1cad81b (diff) |
fix error strings, add a sanity check
Diffstat (limited to 'src/mesa/shader')
-rw-r--r-- | src/mesa/shader/shader_api.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/mesa/shader/shader_api.c b/src/mesa/shader/shader_api.c index 0c4f4837fb..a8ca7d6221 100644 --- a/src/mesa/shader/shader_api.c +++ b/src/mesa/shader/shader_api.c @@ -575,6 +575,18 @@ _mesa_detach_shader(GLcontext *ctx, GLuint program, GLuint shader) shProg->Shaders = newList; shProg->NumShaders = n - 1; + +#ifdef DEBUG + /* sanity check */ + { + for (j = 0; j < shProg->NumShaders; j++) { + assert(shProg->Shaders[j]->Type == GL_VERTEX_SHADER || + shProg->Shaders[j]->Type == GL_FRAGMENT_SHADER); + assert(shProg->Shaders[j]->RefCount > 0); + } + } +#endif + return; } } @@ -598,12 +610,12 @@ _mesa_get_active_attrib(GLcontext *ctx, GLuint program, GLuint index, GLint sz; if (!shProg) { - _mesa_error(ctx, GL_INVALID_VALUE, "glGetActiveUniform"); + _mesa_error(ctx, GL_INVALID_VALUE, "glGetActiveAttrib"); return; } if (!shProg->Attributes || index >= shProg->Attributes->NumParameters) { - _mesa_error(ctx, GL_INVALID_VALUE, "glGetActiveUniform(index)"); + _mesa_error(ctx, GL_INVALID_VALUE, "glGetActiveAttrib(index)"); return; } |