Browse Source

st/mesa: release tgsi tokens for shader states

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 bc99b22a30 ('st/mesa: use a separate VS variant for the draw module')

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
master
Neha Bhende 7 years ago
parent
commit
83ad2e5084
1 changed files with 4 additions and 0 deletions
  1. 4
    0
      src/mesa/state_tracker/st_program.c

+ 4
- 0
src/mesa/state_tracker/st_program.c View File

@@ -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;
}


Loading…
Cancel
Save