draw: Plug leak when combining tessellation with primitive assembly.

Another lavapipe leak found with LeakSanitizer.

This happens when using tessellation without geometry shader but with a
fragment shader that consumes primitive ID, therefore requiring
primitive assembler stage.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10835>
This commit is contained in:
Jose Fonseca 2021-05-17 07:50:28 +01:00 committed by Marge Bot
parent 790ff1ceac
commit 3927a2d946
1 changed files with 5 additions and 0 deletions

View File

@ -725,6 +725,11 @@ llvm_pipeline_generic(struct draw_pt_middle_end *middle,
if (ia_vert_info.count) {
FREE(vert_info->verts);
if (free_prim_info) {
FREE(prim_info->primitive_lengths);
FREE(tes_elts_out);
tes_elts_out = NULL;
}
vert_info = &ia_vert_info;
prim_info = &ia_prim_info;
free_prim_info = TRUE;