mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 13:58:04 +02:00
mesa: Free the util shaders with the gallium's FREE.
This commit is contained in:
parent
b9c5e41688
commit
85b0c171c0
5 changed files with 15 additions and 3 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue