diff options
author | José Fonseca <[email protected]> | 2009-02-19 13:02:47 +0000 |
---|---|---|
committer | José Fonseca <[email protected]> | 2009-02-19 13:29:04 +0000 |
commit | 85b0c171c04c00b4ca9e11a1c79872f5e0cbaf9c (patch) | |
tree | 37e4f4eebbc3c2e29935a0f8922a6613cb64433a /src | |
parent | b9c5e41688de0e2978cf2cc50fd6ba096302884d (diff) |
mesa: Free the util shaders with the gallium's FREE.
Diffstat (limited to 'src')
-rw-r--r-- | src/gallium/auxiliary/util/u_simple_shaders.c | 7 | ||||
-rw-r--r-- | src/gallium/auxiliary/util/u_simple_shaders.h | 4 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_atom_shader.c | 2 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_cb_bitmap.c | 1 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_cb_clear.c | 4 |
5 files changed, 15 insertions, 3 deletions
diff --git a/src/gallium/auxiliary/util/u_simple_shaders.c b/src/gallium/auxiliary/util/u_simple_shaders.c index 3cd2d52c64c..2fcad6fe3d5 100644 --- a/src/gallium/auxiliary/util/u_simple_shaders.c +++ b/src/gallium/auxiliary/util/u_simple_shaders.c @@ -359,3 +359,10 @@ util_make_fragment_passthrough_shader(struct pipe_context *pipe, return pipe->create_fs_state(pipe, shader); } + +void +util_free_shader(struct pipe_shader_state *shader) +{ + FREE((struct tgsi_token *)shader->tokens); + shader->tokens = NULL; +} diff --git a/src/gallium/auxiliary/util/u_simple_shaders.h b/src/gallium/auxiliary/util/u_simple_shaders.h index 8ca4977d715..99b8d9067d6 100644 --- a/src/gallium/auxiliary/util/u_simple_shaders.h +++ b/src/gallium/auxiliary/util/u_simple_shaders.h @@ -60,6 +60,10 @@ util_make_fragment_passthrough_shader(struct pipe_context *pipe, struct pipe_shader_state *shader); +extern void +util_free_shader(struct pipe_shader_state *shader); + + #ifdef __cplusplus } #endif diff --git a/src/mesa/state_tracker/st_atom_shader.c b/src/mesa/state_tracker/st_atom_shader.c index bed3ff4ae5b..486582fce89 100644 --- a/src/mesa/state_tracker/st_atom_shader.c +++ b/src/mesa/state_tracker/st_atom_shader.c @@ -313,7 +313,7 @@ get_passthrough_fs(struct st_context *st) st->passthrough_fs = util_make_fragment_passthrough_shader(st->pipe, &shader); #if 0 /* We actually need to keep the tokens around at this time */ - _mesa_free((void *) shader.tokens); + util_free_shader(&shader); #endif } diff --git a/src/mesa/state_tracker/st_cb_bitmap.c b/src/mesa/state_tracker/st_cb_bitmap.c index 77aac8507e1..ef44a08859c 100644 --- a/src/mesa/state_tracker/st_cb_bitmap.c +++ b/src/mesa/state_tracker/st_cb_bitmap.c @@ -819,6 +819,7 @@ st_destroy_bitmap(struct st_context *st) cso_delete_vertex_shader(st->cso_context, st->bitmap.vs); st->bitmap.vs = NULL; } + util_free_shader(&st->bitmap.vert_shader); if (st->bitmap.vbuf) { pipe_buffer_reference(pipe->screen, &st->bitmap.vbuf, NULL); diff --git a/src/mesa/state_tracker/st_cb_clear.c b/src/mesa/state_tracker/st_cb_clear.c index 0eddda23a7a..20eaaa4ae73 100644 --- a/src/mesa/state_tracker/st_cb_clear.c +++ b/src/mesa/state_tracker/st_cb_clear.c @@ -98,12 +98,12 @@ st_destroy_clear(struct st_context *st) struct pipe_context *pipe = st->pipe; if (st->clear.vert_shader.tokens) { - _mesa_free((void *) st->clear.vert_shader.tokens); + util_free_shader(&st->clear.vert_shader); st->clear.vert_shader.tokens = NULL; } if (st->clear.frag_shader.tokens) { - _mesa_free((void *) st->clear.frag_shader.tokens); + util_free_shader(&st->clear.frag_shader); st->clear.frag_shader.tokens = NULL; } |