summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;
}