Mesa (master): draw/gs: only allocate memory for streams needed.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Jul 7 20:37:17 UTC 2020


Module: Mesa
Branch: master
Commit: 87a388fb29c35af9ecab9fa6eb98c7ee25306ec0
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=87a388fb29c35af9ecab9fa6eb98c7ee25306ec0

Author: Dave Airlie <airlied at redhat.com>
Date:   Fri Jun 19 16:17:48 2020 +1000

draw/gs: only allocate memory for streams needed.

This just allocates the sizeing for streams that are needed.

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

---

 src/gallium/auxiliary/draw/draw_gs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

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;



More information about the mesa-commit mailing list