r600g: Added r600_pipe_shader_destroy().
authorTilman Sauerbeck <tilman@code-monkey.de>
Sat, 23 Oct 2010 11:33:18 +0000 (13:33 +0200)
committerDave Airlie <airlied@redhat.com>
Sun, 24 Oct 2010 02:55:18 +0000 (12:55 +1000)
Not yet complete.

Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
Signed-off-by: Dave Airlie <airlied@redhat.com>
src/gallium/drivers/r600/r600_pipe.h
src/gallium/drivers/r600/r600_shader.c
src/gallium/drivers/r600/r600_state.c

index b0bd2659de9d9f6791a50e62d0efce802d0be849..0bfa7afeadc2df92229c712b7feeef16ff71ccf4 100644 (file)
@@ -208,6 +208,7 @@ void r600_init_context_resource_functions(struct r600_pipe_context *r600);
 /* r600_shader.c */
 int r600_pipe_shader_update(struct pipe_context *ctx, struct r600_pipe_shader *shader);
 int r600_pipe_shader_create(struct pipe_context *ctx, struct r600_pipe_shader *shader, const struct tgsi_token *tokens);
+void r600_pipe_shader_destroy(struct pipe_context *ctx, struct r600_pipe_shader *shader);
 int r600_find_vs_semantic_index(struct r600_shader *vs,
                                struct r600_shader *ps, int id);
 
index 0dd416c0d830da89ff8d14bc03ebe6bda0aa26ee..a4e052c23a321083e20a9a69627f30db8f8fbc8b 100644 (file)
@@ -338,6 +338,17 @@ int r600_pipe_shader_create(struct pipe_context *ctx, struct r600_pipe_shader *s
        return 0;
 }
 
+void
+r600_pipe_shader_destroy(struct pipe_context *ctx, struct r600_pipe_shader *shader)
+{
+       struct r600_pipe_context *rctx = (struct r600_pipe_context *)ctx;
+       struct r600_bc_cf *cf, *next_cf;
+
+       r600_bo_reference(rctx->radeon, &shader->bo, NULL);
+
+       /* FIXME: is there more stuff to free? */
+}
+
 /*
  * tgsi -> r600 shader
  */
index f5601a5effac3a50e990f66e7abbecc9e4277cc6..d496051948f749af36f0f56053c611b5eea73ac1 100644 (file)
@@ -1095,7 +1095,8 @@ static void r600_delete_ps_shader(struct pipe_context *ctx, void *state)
        if (rctx->ps_shader == shader) {
                rctx->ps_shader = NULL;
        }
-       /* TODO proper delete */
+
+       r600_pipe_shader_destroy(ctx, shader);
        free(shader);
 }
 
@@ -1107,7 +1108,8 @@ static void r600_delete_vs_shader(struct pipe_context *ctx, void *state)
        if (rctx->vs_shader == shader) {
                rctx->vs_shader = NULL;
        }
-       /* TODO proper delete */
+
+       r600_pipe_shader_destroy(ctx, shader);
        free(shader);
 }