[Mesa-stable] [Review Request (master branch)] st/mesa: release tgsi tokens for shader states

Marek Olšák maraeo at gmail.com
Thu Dec 19 19:41:20 UTC 2019


Pushed, thanks!

Marek

On Thu, Dec 19, 2019 at 2:22 PM Neha Bhende <bhenden at vmware.com> wrote:

> Since we are using st_common_variant while creating variant for vertext
> program, we can release tokens created in st_create_vp_variant which
> are already stored in respective states.
> This fix memory leak found with piglit tests
>
> Fixes bc99b22a305b ('st/mesa: use a separate VS variant for the draw
> module')
>
> Reviewed-by: Charmaine Lee <charmainel at vmware.com>
> ---
>  src/mesa/state_tracker/st_program.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/src/mesa/state_tracker/st_program.c
> b/src/mesa/state_tracker/st_program.c
> index a9ff68c1f50..ef10399fa18 100644
> --- a/src/mesa/state_tracker/st_program.c
> +++ b/src/mesa/state_tracker/st_program.c
> @@ -694,6 +694,10 @@ st_create_vp_variant(struct st_context *st,
>     else
>        vpv->base.driver_shader = pipe->create_vs_state(pipe, &state);
>
> +   if (state.tokens) {
> +      tgsi_free_tokens(state.tokens);
> +   }
> +
>     return vpv;
>  }
>
> --
> 2.17.1
>
> _______________________________________________
> mesa-stable mailing list
> mesa-stable at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-stable
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-stable/attachments/20191219/184269d9/attachment.htm>


More information about the mesa-stable mailing list