summaryrefslogtreecommitdiff
path: root/src/mesa
diff options
context:
space:
mode:
authorBrian <brian@yutani.localnet.net>2007-04-18 15:22:43 -0600
committerBrian <brian@yutani.localnet.net>2007-04-18 17:14:13 -0600
commitaaa57412c1a682730f27f08bd89a79b8b81f982f (patch)
treee973ee54c0ab778409613e3c243a75a78f0e1817 /src/mesa
parent2a2f8d806f74619f0a7cf97fdc7f7b3ad1cad81b (diff)
fix error strings, add a sanity check
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/shader/shader_api.c16
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;
}