Remove bad assertions, decrement NumShaders in _mesa_detach_shader().
Fixes crashes w/ Brad King's depth peeling test.
diff --git a/src/mesa/shader/shader_api.c b/src/mesa/shader/shader_api.c
index 004c9c8..0c4f483 100644
--- a/src/mesa/shader/shader_api.c
+++ b/src/mesa/shader/shader_api.c
@@ -309,8 +309,6 @@
* what we're expecting.
*/
if (sh && sh->Type == GL_SHADER_PROGRAM_MESA) {
- assert(sh->Type == GL_VERTEX_SHADER ||
- sh->Type == GL_FRAGMENT_SHADER);
return NULL;
}
return sh;
@@ -576,6 +574,7 @@
_mesa_free(shProg->Shaders);
shProg->Shaders = newList;
+ shProg->NumShaders = n - 1;
return;
}
}