Remove bad assertions, decrement NumShaders in _mesa_detach_shader().
authorBrian <brian@yutani.localnet.net>
Wed, 18 Apr 2007 20:55:18 +0000 (14:55 -0600)
committerBrian <brian@yutani.localnet.net>
Wed, 18 Apr 2007 20:55:18 +0000 (14:55 -0600)
Fixes crashes w/ Brad King's depth peeling test.

src/mesa/shader/shader_api.c

index 004c9c8ec3adf059f591c8b61250b060cb89fca3..0c4f4837fbfc711cea1c3e1ef5c84b7150a9bd2b 100644 (file)
@@ -309,8 +309,6 @@ _mesa_lookup_shader(GLcontext *ctx, GLuint name)
        * 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_detach_shader(GLcontext *ctx, GLuint program, GLuint shader)
          _mesa_free(shProg->Shaders);
 
          shProg->Shaders = newList;
+         shProg->NumShaders = n - 1;
          return;
       }
    }