draw: free vertex info from geometry streams.
authorDave Airlie <airlied@redhat.com>
Fri, 19 Jun 2020 05:24:59 +0000 (15:24 +1000)
committerDave Airlie <airlied@redhat.com>
Tue, 7 Jul 2020 20:06:05 +0000 (06:06 +1000)
This info needs to be freed for the non-0 stream.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5555>

src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline_llvm.c

index f2534709832a0b60526d1e7716dcf8050097572c..e198f8f92d8c153246bfac296786c04c3daa7a06 100644 (file)
@@ -582,6 +582,7 @@ llvm_pipeline_generic(struct draw_pt_middle_end *middle,
    const unsigned *elts;
    ushort *tes_elts_out = NULL;
 
+   memset(&gs_vert_info, 0, sizeof(struct draw_vertex_info) * TGSI_MAX_VERTEX_STREAMS);
    assert(fetch_info->count > 0);
    llvm_vert_info.count = fetch_info->count;
    llvm_vert_info.vertex_size = fpme->vertex_size;
@@ -758,6 +759,10 @@ llvm_pipeline_generic(struct draw_pt_middle_end *middle,
    }
 out:
    FREE(vert_info->verts);
+   if (gshader && gshader->num_vertex_streams > 1)
+     for (unsigned i = 1; i < gshader->num_vertex_streams; i++)
+       FREE(gs_vert_info[i].verts);
+
    if (free_prim_info) {
       FREE(tes_elts_out);
       FREE(prim_info->primitive_lengths);