Merge branch 'gallium-0.1' into gallium-tex-surfaces
authorBrian Paul <brian.paul@tungstengraphics.com>
Tue, 20 May 2008 20:38:45 +0000 (14:38 -0600)
committerBrian Paul <brian.paul@tungstengraphics.com>
Tue, 20 May 2008 20:38:45 +0000 (14:38 -0600)
src/mesa/state_tracker/st_cb_program.c
src/mesa/state_tracker/st_context.c

index 3154fc85aa439da5f109b6fea99eb99b89b13e67..f951a928ead32ee32f5b87f7908c1bd0723d0e81 100644 (file)
@@ -89,8 +89,12 @@ static void st_use_program( GLcontext *ctx,
 
 
 
+/**
+ * Called via ctx->Driver.NewProgram() to allocate a new vertex or
+ * fragment program.
+ */
 static struct gl_program *st_new_program( GLcontext *ctx,
-                                         GLenum target, 
+                                         GLenum target,
                                          GLuint id )
 {
    switch (target) {
@@ -118,7 +122,8 @@ static struct gl_program *st_new_program( GLcontext *ctx,
    }
 
    default:
-      return _mesa_new_program(ctx, target, id);
+      assert(0);
+      return NULL;
    }
 }
 
index b407fd884bc2b16f4a2f7bdcca1fe32c9a3791dd..4081722bc71f9be12c9105dcca8def72effca2dd 100644 (file)
@@ -158,9 +158,6 @@ static void st_destroy_context_priv( struct st_context *st )
 {
    uint i;
 
-   st_reference_fragprog(st, &st->fp, NULL);
-   st_reference_vertprog(st, &st->vp, NULL);
-
    draw_destroy(st->draw);
    st_destroy_atoms( st );
    st_destroy_draw( st );
@@ -195,6 +192,9 @@ void st_destroy_context( struct st_context *st )
    /* need to unbind and destroy CSO objects before anything else */
    cso_release_all(st->cso_context);
 
+   st_reference_fragprog(st, &st->fp, NULL);
+   st_reference_vertprog(st, &st->vp, NULL);
+
    _mesa_delete_program_cache(st->ctx, st->pixel_xfer.cache);
 
    _mesa_free_context_data(ctx);