From: Dave Airlie Date: Fri, 19 Jun 2020 06:17:48 +0000 (+1000) Subject: draw/gs: only allocate memory for streams needed. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=87a388fb29c35af9ecab9fa6eb98c7ee25306ec0;p=mesa.git draw/gs: only allocate memory for streams needed. This just allocates the sizeing for streams that are needed. Reviewed-by: Roland Scheidegger Part-of: --- diff --git a/src/gallium/auxiliary/draw/draw_gs.c b/src/gallium/auxiliary/draw/draw_gs.c index b87e5d35f80..f701e82b056 100644 --- a/src/gallium/auxiliary/draw/draw_gs.c +++ b/src/gallium/auxiliary/draw/draw_gs.c @@ -879,8 +879,8 @@ draw_create_geometry_shader(struct draw_context *draw, memset(gs->gs_input, 0, sizeof(struct draw_gs_inputs)); gs->llvm_prim_lengths = 0; - gs->llvm_emitted_primitives = align_malloc(vector_size * PIPE_MAX_VERTEX_STREAMS, vector_size); - gs->llvm_emitted_vertices = align_malloc(vector_size * PIPE_MAX_VERTEX_STREAMS, vector_size); + gs->llvm_emitted_primitives = align_malloc(vector_size * gs->num_vertex_streams, vector_size); + gs->llvm_emitted_vertices = align_malloc(vector_size * gs->num_vertex_streams, vector_size); gs->llvm_prim_ids = align_calloc(vector_size, vector_size); gs->fetch_outputs = llvm_fetch_gs_outputs;